/* libfake437 - a library for the rendering of code page 437 `graphics'
 * Copyright (C) 2008 Jack Kelly <endgame.dos@gmail.com>
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef FAKE437_H
#define FAKE437_H

#include <SDL.h>

#define F437_CHAR_WIDTH   8
#define F437_CHAR_HEIGHT 14
#define F437_DEFAULT_WIDTH 80
#define F437_DEFAULT_HEIGHT 25
#define F437_DEFAULT_WIDTH_PX (F437_DEFAULT_WIDTH * F437_CHAR_WIDTH)
#define F437_DEFAULT_HEIGHT_PX (F437_DEFAULT_HEIGHT * F437_CHAR_HEIGHT)

/* A value >0 means draw the foreground colour.
   A value of 0 means draw the background colour. */
typedef Uint8 f437_char[F437_CHAR_HEIGHT][F437_CHAR_WIDTH];

enum f437_color{
  F437_COLOR_BLACK,
  F437_COLOR_BLUE,
  F437_COLOR_GREEN,
  F437_COLOR_CYAN,
  F437_COLOR_RED,
  F437_COLOR_MAGENTA,
  F437_COLOR_YELLOW,
  F437_COLOR_WHITE,
  F437_COLOR_BBLACK,
  F437_COLOR_BBLUE,
  F437_COLOR_BGREEN,
  F437_COLOR_BCYAN,
  F437_COLOR_BRED,
  F437_COLOR_BMAGENTA,
  F437_COLOR_BYELLOW,
  F437_COLOR_BWHITE,
  F437_NUM_COLORS
};

void f437_putChar(SDL_Surface *surface,
		  Uint16 offsetX, Uint16 offsetY,
		  Uint16 left, Uint16 top, Uint8 ch,
		  enum f437_color fg, enum f437_color bg);
void f437_putCharColor(SDL_Surface *surface,
		       Uint16 offsetX, Uint16 offsetY,
		       Uint16 left, Uint16 top, Uint8 ch,
		       const SDL_Color *fg, const SDL_Color *bg);
void f437_putCharCustom(SDL_Surface *surface,
			Uint16 offsetX, Uint16 offsetY,
			Uint16 left, Uint16 top, const f437_char ch,
			enum f437_color fg, enum f437_color bg);
void f437_putCharCustomColor(SDL_Surface *surface,
			     Uint16 offestX, Uint16 offsetY,
			     Uint16 left, Uint16 top, const f437_char ch,
			     const SDL_Color *fg, const SDL_Color *bg);

#endif
